package com.compass.ui.client;

import java.util.Arrays;

import com.compass.ui.client.data.TestData;
import com.compass.ui.client.model.Folder;
import com.compass.ui.client.model.ScheduleEvent;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.store.TreeStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.treegrid.TreeGrid;
import com.extjs.gxt.ui.client.widget.treegrid.TreeGridCellRenderer;
import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;
import com.google.gwt.user.client.Element;

public class SchedulePanel extends ContentPanel
{
	TreePanel<ModelData> tree;
	TreeStore<ModelData> store;
	
	public SchedulePanel()
	{
		super();
		
		store = new TreeStore<ModelData>();
		store.add(TestData.getDateTreeModel().getChildren(), true);
		tree = new TreePanel<ModelData>(store);
	}
	
	@Override
	protected void onRender(Element parent, int pos)
	{
		tree.setDisplayProperty("name");
		setHeaderVisible(false);
		tree.getStyle().setNodeCloseIcon(null);
		tree.getStyle().setNodeOpenIcon(null);
		add(tree);
		
		super.onRender(parent, pos);
		
		tree.expandAll();
	}
}
